module.exports   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
nop 1
1
// import in package.json via
2
// "node-patternlibrary": "git+https://[email protected]/js/patternlibrary"
3
// "node-patternlibrary": "file:../../js/node-patternlibrary"
4
5
// (global) Patternlibrary module instance
6
var the_patternlibrary;
7
8
// import main Patternlibrary class from file;
9
var Patternlibrary = require ( './lib/patternlibrary.js' );
10
11
/**
12
 * Patternlibrary instance factory
13
 * 
14
 * The first time the function is invoked in the stream, a new instance of 
15
 * the pattern-library is created with the given options.
16
 *
17
 * @param {object} options - Configuration options to pass to the new instance.
18
 * @returns {function} Transform stream function that renders HTML pages.
19
 */
20
module.exports = function(options) {
21
    if (!the_patternlibrary) {
22
    	the_patternlibrary = new Patternlibrary(options);
23
    	//the_patternlibrary.refresh();
24
    }
25
26
    // return initialized Patternlibrary
27
    return the_patternlibrary;
28
};
29
30
module.exports.Patternlibrary = Patternlibrary;
31
32
33
/**
34
 * CLI help message
35
 */
36
var help = function () {
37
	var txt = 'Usage: ...';
38
	process.stdout.write(txt);
39
}; // require('./lib/helpMessage');
40
41
module.exports.help = function() {
42
    help();
43
};
44